package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.ActivityProps;
import com.sc.nft.entity.vo.ActivityPropsUpVO;
import com.sc.nft.entity.vo.ActivityPropsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 活动道具卡表(sc_activity_props)数据Mapper
 *
 * @author Tangzehui
 * @description
 * @since 2024-01-03 16:13:13
 */
@Mapper
public interface ActivityPropsMapper extends BaseMapper<ActivityProps> {

    /**
     * 后台分页显示活动道具卡
     *
     * @param page
     * @param firstTitle
     * @return
     */
    Page<ActivityPropsVO> adminPage(Page page, @Param("status") Boolean status, @Param("firstTitle") String firstTitle, @Param("convertScenario") Integer convertScenario, @Param("daoId") Long daoId);

    /**
     * 获取所有上架的活动道具卡
     *
     * @return
     */
    Page<ActivityPropsUpVO> getUpActivityPropsList(Page page, @Param("convertScenario") Integer convertScenario, @Param("daoId") Long daoId);

    /**
     * 扣减库存
     *
     * @param id
     * @param num
     * @return
     */
    Integer subUsableCount(@Param("id") Long id, @Param("num") Integer num);
}
